package minOperations;

import java.util.Stack;

public class Solution {
    public int minOperations(String[] logs) {
        // 思路 用栈存储已经打开的文件夹
        Stack<String> stack = new Stack<>();
        for (String log: logs) {
            if(log .equals("../")){
                if(!stack.isEmpty()){
                    stack.pop();
                }
            }else if(log.equals("./")){
                continue;
            }else {
                stack.push(log);
            }
        }
        return stack.size();
    }
}
